'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
  let {length,page} = event
	const db = uniCloud.database()
  let data = await db.collection("saying").aggregate().sort({ _id:-1}).skip(page).limit(length).end()
  let count = await db.collection("saying").count()
	return  {
    data,
    count
  }
	//返回数据给客户端
};
